API: Get rid of gtk_draw_insertion_cursor()
authorBenjamin Otte <otte@redhat.com>
Fri, 10 Sep 2010 23:54:48 +0000 (01:54 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:43 +0000 (15:11 +0200)
and rename gtk_cairo_draw_insertion_cursor() to
gtk_draw_insertion_cursor().

gtk/gtk.symbols
gtk/gtkentry.c
gtk/gtklabel.c
gtk/gtkstyle.c
gtk/gtkstyle.h
gtk/gtktextdisplay.c

index 345e1e429aa4d3bfdcd8da2e8d965882ba21bed4..60053a5e3426c8cbee3bda947800135ac4118652 100644 (file)
@@ -1041,7 +1041,6 @@ gtk_style_new
 gtk_style_render_icon
 gtk_style_set_background
 gtk_draw_insertion_cursor
-gtk_cairo_draw_insertion_cursor
 gtk_style_get_style_property
 gtk_style_get_valist
 gtk_style_get
index 392f2cf5361f9f484ca61a679de93cc4b95ddec4..9ce703488be430ad4917fbdbcc66a1392b58995c 100644 (file)
@@ -5677,7 +5677,7 @@ draw_insertion_cursor (GtkEntry      *entry,
   else
     text_dir = GTK_TEXT_DIR_RTL;
 
-  gtk_cairo_draw_insertion_cursor (widget, cr,
+  gtk_draw_insertion_cursor (widget, cr,
                             cursor_location,
                             is_primary, text_dir, draw_arrow);
 }
index 45f089a899efb01a02f8813c391666a8e628285c..15ecef89c39bd4534c047e7c18230292ffeb2c05 100644 (file)
@@ -3921,7 +3921,7 @@ draw_insertion_cursor (GtkLabel      *label,
   else
     text_dir = GTK_TEXT_DIR_RTL;
 
-  gtk_cairo_draw_insertion_cursor (widget, cr, cursor_location,
+  gtk_draw_insertion_cursor (widget, cr, cursor_location,
                             is_primary, text_dir, draw_arrow);
 }
 
index e613d8b3762c2954a6914ccc2e17af7d47624ccc..2e0ad1ce43711f5dec9ad71a2e593f5f8af2cbc4 100644 (file)
@@ -5506,7 +5506,7 @@ _gtk_widget_get_cursor_color (GtkWidget *widget,
 }
 
 /**
- * gtk_cairo_draw_insertion_cursor:
+ * gtk_draw_insertion_cursor:
  * @widget:  a #GtkWidget
  * @cr: cairo context to draw to
  * @location: location where to draw the cursor (@location->width is ignored)
@@ -5522,12 +5522,12 @@ _gtk_widget_get_cursor_color (GtkWidget *widget,
  * Since: 3.0
  **/
 void
-gtk_cairo_draw_insertion_cursor (GtkWidget          *widget,
-                                 cairo_t            *cr,
-                                 const GdkRectangle *location,
-                                 gboolean            is_primary,
-                                 GtkTextDirection    direction,
-                                 gboolean            draw_arrow)
+gtk_draw_insertion_cursor (GtkWidget          *widget,
+                           cairo_t            *cr,
+                           const GdkRectangle *location,
+                           gboolean            is_primary,
+                           GtkTextDirection    direction,
+                           gboolean            draw_arrow)
 {
   gint stem_width;
   gint arrow_width;
@@ -5586,49 +5586,3 @@ gtk_cairo_draw_insertion_cursor (GtkWidget          *widget,
         }
     }
 }
-
-/**
- * gtk_draw_insertion_cursor:
- * @widget:  a #GtkWidget
- * @drawable: a #GdkDrawable
- * @area: (allow-none): rectangle to which the output is clipped, or %NULL if the
- *        output should not be clipped
- * @location: location where to draw the cursor (@location->width is ignored)
- * @is_primary: if the cursor should be the primary cursor color.
- * @direction: whether the cursor is left-to-right or
- *             right-to-left. Should never be #GTK_TEXT_DIR_NONE
- * @draw_arrow: %TRUE to draw a directional arrow on the
- *        cursor. Should be %FALSE unless the cursor is split.
- * 
- * Draws a text caret on @drawable at @location. This is not a style function
- * but merely a convenience function for drawing the standard cursor shape.
- *
- * Since: 2.4
- **/
-void
-gtk_draw_insertion_cursor (GtkWidget          *widget,
-                          GdkDrawable        *drawable,
-                          const GdkRectangle *area,
-                          const GdkRectangle *location,
-                          gboolean            is_primary,
-                          GtkTextDirection    direction,
-                          gboolean            draw_arrow)
-{
-  cairo_t *cr;
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (location != NULL);
-  g_return_if_fail (direction != GTK_TEXT_DIR_NONE);
-
-  cr = gdk_cairo_create (drawable);
-  if (area)
-    {
-      gdk_cairo_rectangle (cr, area);
-      cairo_clip (cr);
-    }
-  
-  gtk_cairo_draw_insertion_cursor (widget, cr, location, is_primary, direction, draw_arrow);
-  
-  cairo_destroy (cr);
-}
index bd156c3b19e404611930b073d9efb55da2e8e986..84a018ce1a0822aebe9252084cb80683bfa6b405 100644 (file)
@@ -670,18 +670,11 @@ void          _gtk_style_shade               (const GdkColor     *a,
                                               gdouble             k);
 
 void   gtk_draw_insertion_cursor    (GtkWidget          *widget,
-                                     GdkDrawable        *drawable,
-                                     const GdkRectangle *area,
+                                     cairo_t            *cr,
                                      const GdkRectangle *location,
                                      gboolean            is_primary,
                                      GtkTextDirection    direction,
                                      gboolean            draw_arrow);
-void   gtk_cairo_draw_insertion_cursor (GtkWidget          *widget,
-                                        cairo_t            *cr,
-                                        const GdkRectangle *location,
-                                        gboolean            is_primary,
-                                        GtkTextDirection    direction,
-                                        gboolean            draw_arrow);
 void   _gtk_widget_get_cursor_color (GtkWidget          *widget,
                                     GdkColor           *color);
 
index 1f4e5580fc8de390120dc9a86d5a5bff799e753d..93be053064ee8045a0edd6d61a71986f48b2241d 100644 (file)
@@ -924,9 +924,9 @@ gtk_text_layout_draw (GtkTextLayout *layout,
              cursor_location.width = 0;
              cursor_location.height = cursor->height;
 
-             gtk_cairo_draw_insertion_cursor (widget, cr, &cursor_location,
-                                               cursor->is_strong,
-                                               dir, have_strong && have_weak);
+             gtk_draw_insertion_cursor (widget, cr, &cursor_location,
+                                         cursor->is_strong,
+                                         dir, have_strong && have_weak);
 
               cursor_list = cursor_list->next;
             }